package com.ffyc.cms.util;


import java.text.SimpleDateFormat;
import java.util.Date;


/**
 *  自定义的String工具类
 *  111
 */
public class StringUtil {

    /**
     * 截取文件扩展名
     * @param fileName
     * @return
     */
     public static String subFileType(String fileName){
         if(fileName!=null){
             return fileName.substring(fileName.lastIndexOf(".")+1);
         }
         return null;
     }

    public static String newFileName(String oldFileName){
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        return  sdf.format(date)+"."+subFileType(oldFileName);
    }

}
